package com.chenxi.vhr.controller.salary;

import com.chenxi.vhr.bean.common.Result;
import com.chenxi.vhr.bean.common.ResultPageInfo;
import com.chenxi.vhr.bean.form.VhrEmpSalaryEditForm;
import com.chenxi.vhr.service.VhrEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 工資账套设置
 * @author : zhangchenxi
 * @create : 2022-02-13
 **/
@RestController
@RequestMapping("/salary/sobConfig")
public class SalarySobConfigController {

    @Autowired
    VhrEmployeeService employeeService;

    @GetMapping("/{page}/{size}")
    public ResultPageInfo list(@PathVariable Integer page, @PathVariable Integer size) {
        ResultPageInfo resultPageInfo = employeeService.listEmpWithSalary(page, size);
        return resultPageInfo;
    }

    @PutMapping
    public Result updateEmpSalary(@RequestBody VhrEmpSalaryEditForm form) {
        return employeeService.updateEmpSalary(form.getEmpId(), form.getSalaryId());
    }

}
